<template>
  <div>
    <button @click="getStudentInfo">点击获取学生信息</button>
    <button @click="getCarInfo">点击获取汽车信息</button>  
  </div>
 
</template>

<script>
import axios from 'axios'
export default {
  name: 'App',
 methods: {
    getStudentInfo() {
        axios.get('http://localhost:8080/api1/students').then(
            response=>{
                console.log(response.data)
            },
            error =>{
                console.log(error)
            }
        )
    },
    getCarInfo(){
        axios.get('http://localhost:8080/api2/cars').then(
            response =>{console.log(response.data)},
            error =>{console.log(error)}
        )
    }
 },
  
  
}
</script>

